package utils.titles;

import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;

import java.lang.reflect.Type;

/**
 * Created by nuno-rafael-figueiredo on 18-07-2014.
 */
public class TitleSerializer implements JsonSerializer<Title> {
    @Override
    public JsonElement serialize(Title src, Type typeOfSrc, JsonSerializationContext context) {
        return new JsonPrimitive(src.toCapitalized());
    }
}
